﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class watermanager : MonoBehaviour
{
    private SpriteRenderer self;
    public Sprite s1, s2;
    public float t;
    private float tdown;
	void Start ()
    {
        self = GetComponent<SpriteRenderer>();
        tdown = t;
	}
	

	void Update ()
    {
        if (tdown < 0)
        {
            change();
            tdown += t;
        }
        tdown -= Time.deltaTime;
	}
    public void change()
    {
        if (self.sprite == s1) self.sprite = s2;
        else self.sprite = s1;
    }
}
